package easy;

public class a961_重复N次的元素 {

    public int repeatedNTimes(int[] A) {
        for (int i = 1; i < A.length; i++) {
            if ((A[i] == A[i - 1])
                    || (i >= 2 && A[i] == A[i - 2])
                    || (i >= 3 && A[i] == A[i - 3])) {
                return A[i];
            }
        }
        return 0;
    }
}
